﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BasicForms;
using Lists;
using GeneralLibs;

namespace Portal
{
    public partial class FrmSetStoreID : FrmOKCancel
    {
        public FrmSetStoreID()
        {
            InitializeComponent();
        }

        private void FrmSetStoreID_Load(object sender, EventArgs e)
        {
            if (DesignMode) return;
            try
            {
                cmbStoreName1.DataSource = DanhMucStore.GetAll().DataView;
                cmbStoreName1.DisplayColumn = "Name";
                cmbStoreName1.ValueColumn = "StoreID";
                cmbStoreName1.AddVisibleColumn("StoreID", "StoreID", 60);
                cmbStoreName1.AddVisibleColumn("Name", "Tên cửa hàng", 200);
                cmbStoreName1.EditValue = GeneralLibs.Config.StoreID;
            }
            catch (Exception ex)
            {
                BasicForms.FrmExceptionNotifier.ShowAndLog(ex);
            }
        }

        private void btnOK_Click_1(object sender, EventArgs e)
        {
            GeneralLibs.Config.StoreID = (int)cmbStoreName1.EditValue;
            this.Dispose();
        }
    }
}
